<?php
/**
 * 定义当前版本
 * 
 */
define('BEAUTYVERSION','1.0.0');

/**
 * 加载全局配置文件
 * 
 */
require_once(BASEPATH.'/config/config'.EXT);

/**
 * 加载核心文件kernel
 * 
 */
require_once(BASEPATH.'kernel/kernel'.EXT);
$kernel = new kernel();

/**
 * 加载基类控制器
 * 
 */
require_once(BASEPATH.'kernel/control'.EXT);
/**
 * 加载基类模型
 */
require_once(BASEPATH.'kernel/model'.EXT);
/**
 * 加在URI
 * 
 * $control 控制器
 * $function 函数
 * 
 */
$URI = $kernel->loadLib('URI');
$seg = $URI->segments();
$control = $seg[0];
$function = $seg[1];
// $control = $URI->getSeg(0);
//$function = $URI->getSeg(2);
if($control == '') $control = 'desktop';
if($function == '') $function = 'index';
if(in_array($control,config::$control)) {
	if(file_exists(BASEPATH.'control/'.$control.EXT)) {
		include_once(BASEPATH.'control/'.$control.EXT);
		$control = new $control();
		if(method_exists($control,$function)) {
			$control->$function();
		}
	} else {
		die('no such file:'.BASEPATH.'control/'.$control.EXT);
	} 
} else {
	die('no such control in config file :');
}

?>